//
//  WNUserInfo.m
//  Whatnet_iOS
//
//  Created by 北辰 on 2019/5/10.
//  Copyright © 2019 什么网络. All rights reserved.
//

#import "WNUserInfo.h"

@implementation WNUserInfo
//- (id)copyWithZone:(NSZone *)zone {
//    WNUserInfo *p = [[WNUserInfo allocWithZone:zone] init];
//    p.userID = self.userID;
//    p.nickname = self.nickname;
//    p.avatar = self.avatar;
//    p.signature = self.signature;
//    p.sex = self.sex;
//    p.authStatus = self.authStatus;
//    p.background = self.background;
//    p.birthday = self.birthday;
//    p.cityCode = self.cityCode;
//    p.cityName = self.cityName;
//    p.fanses = self.fanses;
//    p.followers = self.followers;
//    p.likers = self.likers;
//    p.black = self.black;
//    p.isFans = self.isFans;
//    p.isFollow = self.isFollow;
//    p.isFriend = self.isFriend;
//    p.isOnline = self.isOnline;
//    return p;
//}

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{@"userID" : @"id",
             @"isFans" : @"fan",
             @"isFollow" : @"follower",
             @"isFriend" : @"friend",
             @"isOnline" : @"online",
             @"background":@"backImg"
             };
}


/**
 设置社交相关信息
 
 @param dict
 */
- (void)setSocialData:(NSDictionary *)dict{
//    self.fanses = [dict[@"fan"] integerValue];
//    self.followers = [dict[@"follower"] integerValue];
//    self.likers = [dict[@"liker"] integerValue];
}

- (void)setDataWithDict:(NSDictionary *)dict{
//    self.userID    = [dict[@"id"] stringValue];
//    self.signature = dict[@"signature"];
//    self.nickname  = dict[@"nickname"] ? :@"";
//    self.avatar   = dict[@"avatar"];
//    self.sex    = dict[@"sex"];
//    self.background   = dict[@"backImg"];
//    self.authStatus = [dict[@"authStatus"] integerValue];
//    self.cityName = dict[@"cityName"];
//    self.black = dict[@"black"];
//    self.cityCode = dict[@"cityCode"];
//    self.birthday = [dict[@"birthday"] stringValue];//后台传过来的是longlong 本地转成字符串
//    self.isFans = [dict[@"fan"] boolValue];
//    self.isFollow = [dict[@"follower"] boolValue];
//    self.isFriend = [dict[@"friend"] boolValue];
//    self.live = [dict[@"live"] boolValue];
//    self.isOnline = [dict[@"online"] boolValue];
}

+ (WNBlackRelationType)BlackTypeWithString:(NSString *)black{
//    【normal, me, opp, both】
    WNBlackRelationType blackType  = 0;
    if ([black isEqualToString:@"both"]) {
        blackType = WNBlackBoth;
    }else if ([black isEqualToString:@"opp"]){
        blackType = WNBlackOpp;
    }else if ([black isEqualToString:@"me"]){
        blackType = WNBlackMe;
    }else{
        blackType = WNBlackNomal;
    }
    return blackType;
}


//需要归档的字段
- (NSArray<NSString *> *)codingKeys {
    return @[
        @"userid",
        @"phone",
        @"headimage",
        @"nickname",
        @"name",
        @"viplevel",
        @"activitylevel",
        @"candynumber",
        @"password",
        @"bankname",
        @"cardnum",
        @"extend3",
        @"cardid",
        @"totalcandynumber",
        @"suserid"];
}
@end
